<template>
  <view class="page">
    <!-- <CustomNav :isBack="true" title="车次详情"></CustomNav> -->
    <view class="content-block" v-if="detail">
      <view class="title">{{ detail.title }}</view>
      <view class="time">{{ detail.createTime }}</view>
      <mp-html :content="detail.content"></mp-html>
    </view>
  </view>
</template>

<script>
import { getTrainDetailApi } from "@/api/train.js";
import mpHtml from "../../uni_modules/mp-html/components/mp-html/mp-html.vue";
export default {
  components: { mpHtml },
  data() {
    return {
      detail: null,
    };
  },
  methods: {
    getDetail(id) {
      getTrainDetailApi({ id }).then((res) => {
        this.detail = res;
      });
    },
  },
  onLoad(options) {
    if (options.id) {
      this.getDetail(options.id);
    }
  },
};
</script>

<style lang="scss" scoped>
.page {
  background-color: #f7f6f9;
  min-height: 100vh;
  .content-block {
    padding: 30rpx;
    .title {
      font-size: 36rpx;
      font-weight: bold;
      margin-bottom: 20rpx;
    }
    .time {
      font-size: 26rpx;
      color: #999;
      margin-bottom: 30rpx;
    }
    .content {
      font-size: 30rpx;
      line-height: 1.6;
    }
  }
}
</style> 